import {Controller, Get} from '@nestjs/common';
import {UserService} from "./user.service"
import {LogService} from "../log/log.service"
import {CatService} from "../cat/cat.service"
import {AuthService} from "../auth/auth.service"

// 在user.controller.ts中就可以使用 LogService
@Controller('user')
export class UserController {
    constructor(
        private readonly userService: UserService,
        // private readonly logService: LogService,
        private readonly catService: CatService,
        private readonly authService: AuthService,
    ) {
    }

    /**
     * @Get([path]) 当前的path会拼接到 @Controller('user') 到里面的user路径后面, 不写就表示为空
     */
    @Get()
    async userList(): Promise<any[]> {
        // 控制层访问服务层的userList方法

        // this.catService.sayMiaoMiao("我是猫猫,我saymiaomiao").then((res) => {
        //     console.log(123123123, res);
        // })
        // this.logService.log("运行了 userList 控制器, 调用了 logService 的module模块")
        this.authService.authFn("auth")
        // return await this.userService.userList();
        return [123]
    }
}
